import { ApiProperty } from '@nestjs/swagger';
import { IsString, IsNotEmpty, Matches } from 'class-validator';

export class UpdateTimeSlotDto {
  @ApiProperty({ example: '12:21:21', description: '开始时间必须填写' })
  @Matches(/^([01]\d|2[0-3]):([0-5]\d):([0-5]\d)$/, {
    message: 'Invalid format. Expected format: hh:mm:ss',
  })
  @IsNotEmpty({ groups: ['create'], message: '开始时间必须填写' })
  start_date: Date;

  @ApiProperty({ example: '12:21:21', description: '结束时间必须填写' })
  @Matches(/^([01]\d|2[0-3]):([0-5]\d):([0-5]\d)$/, {
    message: 'Invalid format. Expected format:  hh:mm:ss',
  })
  @IsNotEmpty({ groups: ['create'], message: '结束时间必须填写' })
  end_date: Date;
}
